<template>
    <div class="breadcrumb">
        <el-breadcrumb separator="/">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <template v-if="route.path !== '/index'">
                <el-breadcrumb-item :to="{ path: item.path }" :key="item.name" v-for="item in route.matched">{{
                    item.meta.title
                }}</el-breadcrumb-item>
            </template>
        </el-breadcrumb>
    </div>
</template>

<script setup lang="ts">
import { useRoute } from "vue-router";
const route = useRoute();
</script>

<style scoped>
.breadcrumb {
    padding-bottom: 20px;
}
</style>
